<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form id="tableact" action="/addStudent" method="post">
    <table  border="0" cellspacing="0" cellpadding="10">
        <tr>
            <td>姓名 Name</td>
            <td><input class="inpu" type="text" placeholder="请输入姓名" name="sName" id="sName"/></td>
        </tr>
        <tr>
            <td>性别 Gender</td>
            <td>
                <select name="gender">
                    <option value="男">男</option>
                    <option value="女">女</option>
                </select>
                </td>
        </tr>
        <tr>
            <td>出生日期 Birthday</td>
            <td><input class="inpu" type="date" placeholder="请输入出生日期" name="birthday" id="birthday"/></td>
        </tr>
        <tr>
            <td>手机号 Phone</td>
            <td><input class="inpu" type="text" placeholder="手机号" name="phone" id="phone"/></td>
        </tr>

        <tr>
            <td>讲师 Teacher</td>
            <td>
                <select name="tId">
                    <option value="1">小1</option>
                    <option value="2">小2</option>
                </select>
            </td>
        </tr>

        <tr>
            <td>班级 Class</td>
            <td>
                <select name="cId">
                    <option value="1">中级班</option>
                    <option value="2">高级班</option>
                </select>
            </td>
        </tr>

        <tr>
            <td>学院 Institute</td>
            <td>
                <select name="iId">
                    <option value="1">中级学院</option>
                    <option value="2">高级学院</option>
                </select>
            </td>
        </tr>
        <tr>
            <td>
                <input type="button" class="submitButton" value="提交" style="width: 90px;height:26px
                ;background-color: lightblue;color:white;border:none;" />
            </td>
        </tr>
    </table>
</form>
</body>

<script src="webjars/jquery/2.1.0/jquery.min.js"></script>
<script>

$(function (){
    $('.submitButton').click(function (){
        var $tableact =  $('#tableact').serialize();
        $.post("/addStudent",$tableact,function (data){
            if(data == "Success"){
                window.location.href="/findAll";
            }else {
                return ;
            }
        })
    })
})



</script>
</html>